package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.hmo.mall.utils.SpUtil;
import xhwl.retrofitrx.BaseApi;

/**
 * 获取用户个人信息
 * Created by admin on 2017/1/16.
 */

public class UserInfoApi extends BaseApi {
    UserInfoReq req;

    public UserInfoApi() {
        req = new UserInfoReq();
        setShowDialog(true);

    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getUserInfo(requestBody);
    }

    public class UserInfoReq {

        /**
         * member_mobile : 18511334282
         */

        private String member_mobile;

        public UserInfoReq() {
            this.member_mobile = SpUtil.getString(SpUtil.MEMBER_MOBILE, "");
        }
    }
}
